Skip to content

Update JSON formatter to encode bytes as Base64 strings.#9438

Merged
aemous merged 2 commits intoaws:developfrom
aemous:cbor-json-formatter-v1
Apr 16, 2025
Merged

Update JSON formatter to encode bytes as Base64 strings.#9438
aemous merged 2 commits intoaws:developfrom
aemous:cbor-json-formatter-v1

Conversation

@aemous
Copy link
Contributor

@aemous aemous commented Apr 14, 2025

v1 port of #9424

Description of changes

  • Modifies JSON formatter so that it serializes bytes into a UTF-8 Base64 string.
  • Add a regression unit test to verify that binary data in the response gets base-64 encoded.

Description of tests

  • Call a service operation using the CBOR protocol and receive a response containing a member with raw bytes. Prior to this change, error code 255 is observed and the full response is not printed. After the change, the output is fully printed, and it matches the output seen when using the JSON protocol on the same operation.
  • Ran and passed all test suites and CI.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@aemous aemous requested review from a team and ashovlin April 14, 2025 14:27
@codecov-commenter
Copy link

codecov-commenter commented Apr 14, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 93.40%. Comparing base (5f07db1) to head (7d69ab8).
Report is 65 commits behind head on develop.

Files with missing lines Patch % Lines
awscli/utils.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #9438   +/-   ##
========================================
  Coverage    93.39%   93.40%           
========================================
  Files          210      210           
  Lines        16983    16986    +3     
========================================
+ Hits         15861    15865    +4     
+ Misses        1122     1121    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aemous aemous merged commit 5de2e23 into aws:develop Apr 16, 2025
30 checks passed
aws-sdk-python-automation added a commit that referenced this pull request Apr 16, 2025
* release-1.38.35:
  Bumping version to 1.38.35
  Update changelog based on model updates
  Update JSON formatter to encode bytes as Base64 strings. (#9438)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants